<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>页面禁止调试</title>
    <script type="text/javascript">
      // 终极增强防调试
      (() => {
        function block() {
          if (
            window.outerHeight - window.innerHeight > 200 ||
            window.outerWidth - window.innerWidth > 200
          ) {
            document.body.innerHTML = "检测到非法调试,请关闭后刷新重试!";
          }
          setInterval(() => {
            (function () {
              return false;
            })
              ["constructor"]("debugger")
              ["call"]();
          }, 50);
        }
        try {
          block();
        } catch (err) {}
      })();

      // 禁止右键菜单
      document.oncontextmenu = function () {
        return false;
      };
      // 禁止F12快捷键
      document.onkeydown = function (e) {
        if (e.keyCode === 123) {
          return false;
        }
      };
      // 检测开发者工具
        // setInterval(function () {
        //   console.log(console);
        //   if (
        //     typeof console !== "undefined" &&
        //     typeof console.clear !== "undefined"
        //   ) {
        //     location.reload();
        //   }
        // }, 10000);
    </script>
  </head>
  <body>
    <div>
        <h1>页面禁止调试</h1>
    </div>
  </body>
</html>
